package com.github.sbb.sherry.primitives.api;

import com.github.sbb.sherry.primitives.exception.FetcherException;
import java.util.Map;

public interface Fetcher {

  String name();

  byte getDefaultFetchMethod();

  /**
   * 单次查询
   *
   * @param params 请求参数
   * @return 单条 Fact
   * @throws FetcherException 获取异常
   */
  Fact emit(Map<String, Object> params) throws FetcherException;

  /**
   * 多次查询
   *
   * @param params 查询条件
   * @return Facts
   */
  Facts batchEmit(Map<String, Object> params) throws FetcherException;

}
